
const arr = Array.from({ length: 100 }, () => Math.floor(Math.random() * 100));

for (let i = 1; i < arr.length; i++) {
  const temp = arr[i];
  let j = i - 1;
  while (j >= 0 && arr[j] > temp) {
    arr[j + 1] = arr[j];
    j--;
  }
  arr[j + 1] = temp;
}
var fs=require("fs");


fs.writeFileSync('./sorted.txt', arr.join(','));